package red.mlz.appconsumer.feign.category;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import red.mlz.appconsumer.domain.category.CategoryListVo;
import red.mlz.common.entity.category.Category;

import java.util.List;
import java.util.Map;

@FeignClient(name = "game-service", contextId = "category")
public interface CategoryFeign {

    @RequestMapping("/game-service/category/getById")
    Category getById(@RequestParam(name = "id")Long id);

    @RequestMapping("/game-service/category/getCategoryNameByParentId")
    List<String> getCategoryNameByParentId(@RequestParam(name = "parentId")Long parentId);

    @RequestMapping("/game-service/category/list")
    CategoryListVo getCategoryList();

    @RequestMapping("/game-service/category/third_level_category")
    Map<String, Object> getThirdLevelCategory(@RequestParam Long parentId,
                                              @RequestParam(required = false) Long selectedId);

    @RequestMapping("/game-service/category/listByIds")
    List<Category> getListByIds(@RequestParam(name = "categoryIds") List<Long> categoryIds);
}
